<!DOCTYPE html><html lang="zh-CN" data-theme="light"><head><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><title>Butterfly 主题魔改记录 | 云玩家</title><meta name="keywords" content="Hexo,搭建站点"><meta name="author" content="云玩家"><meta name="copyright" content="云玩家"><meta name="format-detection" content="telephone=no"><meta name="theme-color" content="#ffffff"><meta name="description" content="记录下我对 Butterfly 主题的魔改, 一方面可供参考, 另一方面可以记录下自己的修改方便查找. 本博客已开源! 请看 Hexo modify theme butterfly. 以下魔改部分集合到魔改主题, 部分已放弃 (不兼容或者其他原因). 如果更改失效, 可能是版本问题, 如果想要尽快使用这些魔改, 最便捷的方式是直接使用我的魔改主题. 魔改主题保留了所有原配置, 所有魔改配置均可关闭">
<meta property="og:type" content="article">
<meta property="og:title" content="Butterfly 主题魔改记录">
<meta property="og:url" content="http://yunist.cn/hexo/butterfly_modify/index.html">
<meta property="og:site_name" content="云玩家">
<meta property="og:description" content="记录下我对 Butterfly 主题的魔改, 一方面可供参考, 另一方面可以记录下自己的修改方便查找. 本博客已开源! 请看 Hexo modify theme butterfly. 以下魔改部分集合到魔改主题, 部分已放弃 (不兼容或者其他原因). 如果更改失效, 可能是版本问题, 如果想要尽快使用这些魔改, 最便捷的方式是直接使用我的魔改主题. 魔改主题保留了所有原配置, 所有魔改配置均可关闭">
<meta property="og:locale" content="zh_CN">
<meta property="og:image" content="http://yunist.cn/hexo/butterfly_modify/butterfly_modify.jpeg">
<meta property="article:published_time" content="2020-04-13T03:26:37.000Z">
<meta property="article:modified_time" content="2021-08-14T04:39:34.358Z">
<meta property="article:author" content="云玩家">
<meta property="article:tag" content="Hexo">
<meta property="article:tag" content="搭建站点">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="http://yunist.cn/hexo/butterfly_modify/butterfly_modify.jpeg"><link rel="shortcut icon" href="/img/favicon.ico"><link rel="canonical" href="http://yunist.cn/hexo/butterfly_modify/"><link rel="preconnect" href="//cdn.jsdelivr.net"/><link rel="preconnect" href="//s4.cnzz.com"/><link rel="preconnect" href="//busuanzi.ibruce.info"/><link rel="stylesheet" href="/css/index.css"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free/css/all.min.css" media="print" onload="this.media='all'"><script async="async" data-pjax="data-pjax" src="https://s4.cnzz.com/z_stat.php?id=1278869595&amp;web_id=1278869595"></script><script>const GLOBAL_CONFIG = { 
  root: '/',
  algolia: undefined,
  localSearch: {"path":"search.xml","languages":{"hits_empty":"找不到您查询的内容：${query}"}},
  translate: undefined,
  noticeOutdate: undefined,
  highlight: {"plugin":"highlighjs","highlightCopy":true,"highlightLang":true},
  copy: {
    success: '复制成功',
    error: '复制错误',
    noSupport: '浏览器不支持'
  },
  relativeDate: {
    homepage: false,
    post: false
  },
  runtime: '',
  date_suffix: {
    just: '刚刚',
    min: '分钟前',
    hour: '小时前',
    day: '天前',
    month: '个月前'
  },
  copyright: undefined,
  lightbox: 'fancybox',
  Snackbar: undefined,
  source: {
    jQuery: 'https://cdn.jsdelivr.net/npm/jquery@latest/dist/jquery.min.js',
    justifiedGallery: {
      js: 'https://cdn.jsdelivr.net/npm/justifiedGallery/dist/js/jquery.justifiedGallery.min.js',
      css: 'https://cdn.jsdelivr.net/npm/justifiedGallery/dist/css/justifiedGallery.min.css'
    },
    fancybox: {
      js: 'https://cdn.jsdelivr.net/npm/@fancyapps/fancybox@latest/dist/jquery.fancybox.min.js',
      css: 'https://cdn.jsdelivr.net/npm/@fancyapps/fancybox@latest/dist/jquery.fancybox.min.css'
    }
  },
  isPhotoFigcaption: false,
  islazyload: false,
  isanchor: false
}</script><script src="/js/yuntools.js"></script><script id="config-diff">var GLOBAL_CONFIG_SITE = { 
  isPost: true,
  isHome: false,
  isHighlightShrink: false,
  isToc: true,
  postUpdate: '2021-08-14 12:39:34'
}</script><noscript><style type="text/css">
  #nav {
    opacity: 1
  }
  .justified-gallery img {
    opacity: 1
  }

  #recent-posts time,
  #post-meta time {
    display: inline !important
  }
</style></noscript><script>(win=>{
    win.saveToLocal = {
      set: function setWithExpiry(key, value, ttl) {
        if (ttl === 0) return
        const now = new Date()
        const expiryDay = ttl * 86400000
        const item = {
          value: value,
          expiry: now.getTime() + expiryDay,
        }
        localStorage.setItem(key, JSON.stringify(item))
      },

      get: function getWithExpiry(key) {
        const itemStr = localStorage.getItem(key)

        if (!itemStr) {
          return undefined
        }
        const item = JSON.parse(itemStr)
        const now = new Date()

        if (now.getTime() > item.expiry) {
          localStorage.removeItem(key)
          return undefined
        }
        return item.value
      }
    }
  
    win.getScript = url => new Promise((resolve, reject) => {
      const script = document.createElement('script')
      script.src = url
      script.async = true
      script.onerror = reject
      script.onload = script.onreadystatechange = function() {
        const loadState = this.readyState
        if (loadState && loadState !== 'loaded' && loadState !== 'complete') return
        script.onload = script.onreadystatechange = null
        resolve()
      }
      document.head.appendChild(script)
    })
  
      win.activateDarkMode = function () {
        document.documentElement.setAttribute('data-theme', 'dark')
        if (document.querySelector('meta[name="theme-color"]') !== null) {
          document.querySelector('meta[name="theme-color"]').setAttribute('content', '#0d0d0d')
        }
      }
      win.activateLightMode = function () {
        document.documentElement.setAttribute('data-theme', 'light')
        if (document.querySelector('meta[name="theme-color"]') !== null) {
          document.querySelector('meta[name="theme-color"]').setAttribute('content', '#ffffff')
        }
      }
      const t = saveToLocal.get('theme')
    
          if (t === 'dark') activateDarkMode()
          else if (t === 'light') activateLightMode()
        
      const asideStatus = saveToLocal.get('aside-status')
      if (asideStatus !== undefined) {
        if (asideStatus === 'hide') {
          document.documentElement.classList.add('hide-aside')
        } else {
          document.documentElement.classList.remove('hide-aside')
        }
      }
    })(window)</script><link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/cnyist/blog/css/font.css"><meta name="generator" content="Hexo 5.4.0"></head><body><div id="web_bg"></div><div id="sidebar"><div id="menu-mask"></div><div id="sidebar-menus"><div class="author-avatar"><img class="avatar-img" src="https://cdn.jsdelivr.net/gh/cnyist/blog/img/avatar.svg" onerror="onerror=null;src='/img/friend_404.gif'" alt="avatar"/></div><div class="site-data"><div class="data-item is-center"><div class="data-item-link"><a href="/archives/"><div class="headline">文章</div><div class="length-num">97</div></a></div></div><div class="data-item is-center"><div class="data-item-link"><a href="/tags/"><div class="headline">标签</div><div class="length-num">40</div></a></div></div><div class="data-item is-center"><div class="data-item-link"><a href="/categories/"><div class="headline">分类</div><div class="length-num">27</div></a></div></div></div><hr/><div class="menus_items"><div class="menus_item"><a class="site-page" href="/"><i class="fa-fw fas fa-home"></i><span> 主页</span></a></div><div class="menus_item"><a class="site-page" href="/archives/"><i class="fa-fw fas fa-archive"></i><span> 时间轴</span></a></div><div class="menus_item"><a class="site-page" href="/tags/"><i class="fa-fw fas fa-tags"></i><span> 标签</span></a></div><div class="menus_item"><a class="site-page" href="/categories/"><i class="fa-fw fas fa-folder-open"></i><span> 分类</span></a></div><div class="menus_item"><a class="site-page" href="/link/"><i class="fa-fw fas fa-link"></i><span> 友链</span></a></div><div class="menus_item"><a class="site-page" href="/chat/"><i class="fa-fw fas fa-comments"></i><span> 闲聊室</span></a></div><div class="menus_item"><a class="site-page" href="/about/"><i class="fa-fw fas fa-user"></i><span> about</span></a></div><div class="menus_item"><a class="site-page" href="javascript:void(0);"><i class="fa-fw iconfont icon-Web"></i><span> 镜像站点</span><i class="fas fa-chevron-down expand"></i></a><ul class="menus_item_child"><li><a class="site-page" target="_blank" rel="noopener" href="https://yunist.gitee.io"><i class="fa-fw iconfont icon-gitee-fill-round"></i><span> Gitee Pages</span></a></li></ul></div></div></div></div><div class="post" id="body-wrap"><header class="post-bg" id="page-header" style="background-image: url('/hexo/butterfly_modify/butterfly_modify.jpeg')"><nav id="nav"><span id="blog_name"><a id="site-name" href="/">云玩家</a></span><div id="menus"><div id="search-button"><a class="site-page social-icon search"><i class="fas fa-search fa-fw"></i><span> 搜索</span></a></div><div class="menus_items"><div class="menus_item"><a class="site-page" href="/"><i class="fa-fw fas fa-home"></i><span> 主页</span></a></div><div class="menus_item"><a class="site-page" href="/archives/"><i class="fa-fw fas fa-archive"></i><span> 时间轴</span></a></div><div class="menus_item"><a class="site-page" href="/tags/"><i class="fa-fw fas fa-tags"></i><span> 标签</span></a></div><div class="menus_item"><a class="site-page" href="/categories/"><i class="fa-fw fas fa-folder-open"></i><span> 分类</span></a></div><div class="menus_item"><a class="site-page" href="/link/"><i class="fa-fw fas fa-link"></i><span> 友链</span></a></div><div class="menus_item"><a class="site-page" href="/chat/"><i class="fa-fw fas fa-comments"></i><span> 闲聊室</span></a></div><div class="menus_item"><a class="site-page" href="/about/"><i class="fa-fw fas fa-user"></i><span> about</span></a></div><div class="menus_item"><a class="site-page" href="javascript:void(0);"><i class="fa-fw iconfont icon-Web"></i><span> 镜像站点</span><i class="fas fa-chevron-down expand"></i></a><ul class="menus_item_child"><li><a class="site-page" target="_blank" rel="noopener" href="https://yunist.gitee.io"><i class="fa-fw iconfont icon-gitee-fill-round"></i><span> Gitee Pages</span></a></li></ul></div></div><div id="toggle-menu"><a class="site-page"><i class="fas fa-bars fa-fw"></i></a></div></div></nav><div id="post-info"><h1 class="post-title">Butterfly 主题魔改记录</h1><div id="post-meta"><div class="meta-firstline"><span class="post-meta-date"><i class="far fa-calendar-alt fa-fw post-meta-icon"></i><span class="post-meta-label">发表于</span><time class="post-meta-date-created" datetime="2020-04-13T03:26:37.000Z" title="发表于 2020-04-13 11:26:37">2020-04-13</time><span class="post-meta-separator">|</span><i class="fas fa-history fa-fw post-meta-icon"></i><span class="post-meta-label">更新于</span><time class="post-meta-date-updated" datetime="2021-08-14T04:39:34.358Z" title="更新于 2021-08-14 12:39:34">2021-08-14</time></span><span class="post-meta-categories"><span class="post-meta-separator">|</span><i class="fas fa-inbox fa-fw post-meta-icon"></i><a class="post-meta-categories" href="/categories/Hexo/">Hexo</a></span></div><div class="meta-secondline"><span class="post-meta-separator">|</span><span class="post-meta-pv-cv"><i class="far fa-eye fa-fw post-meta-icon"></i><span class="post-meta-label">阅读量:</span><span id="busuanzi_value_page_pv"></span></span><span class="post-meta-separator">|</span><span class="post-meta-commentcount"><i class="far fa-comments fa-fw post-meta-icon"></i><span class="post-meta-label">评论数:</span><a href="/hexo/butterfly_modify/#post-comment"><span id="twikoo-count"></span></a></span></div></div></div></header><main class="layout" id="content-inner"><div id="post"><article class="post-content" id="article-container"><p>记录下我对 Butterfly 主题的魔改, 一方面可供参考, 另一方面可以记录下自己的修改方便查找.</p>
<p><strong>本博客已开源! 请看 <a href="https://yunist.cn/hexo/hexo_modify_theme_butterfly/">Hexo modify theme butterfly</a>. 以下魔改部分集合到魔改主题, 部分已放弃 (不兼容或者其他原因). 如果更改失效, 可能是版本问题, 如果想要尽快使用这些魔改, 最便捷的方式是直接使用我的魔改主题. 魔改主题保留了所有原配置, 所有魔改配置均可关闭.</strong></p>
<h1 id="Mathjax-公式渲染去除滚动条"><a href="#Mathjax-公式渲染去除滚动条" class="headerlink" title="Mathjax 公式渲染去除滚动条"></a>Mathjax 公式渲染去除滚动条</h1><p>进入 <code>source/css/_layout/third-party.styl</code> , 找到如下内容</p>
<figure class="highlight styl"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">.has-jax</span><br><span class="line">  <span class="attribute">overflow</span>: auto</span><br></pre></td></tr></table></figure>

<p>改成</p>
<figure class="highlight styl"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">.has-jax</span><br><span class="line">  <span class="attribute">overflow</span>: visible</span><br></pre></td></tr></table></figure>

<h1 id="设置半透明"><a href="#设置半透明" class="headerlink" title="设置半透明"></a>设置半透明</h1><p>效果看我博客. </p>
<p>进入<code>source/css/_layout/page.styl</code> 文件, 找到以下内容</p>
<figure class="highlight styl"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line">.layout_page</span><br><span class="line">  <span class="attribute">display</span>: flex</span><br><span class="line">  <span class="attribute">align-items</span>: flex-start</span><br><span class="line">  <span class="attribute">margin</span>: <span class="number">0</span> auto</span><br><span class="line">  <span class="attribute">padding</span>: <span class="number">2rem</span> <span class="number">15px</span></span><br><span class="line">  <span class="attribute">max-width</span>: <span class="number">1200px</span></span><br></pre></td></tr></table></figure>

<p> 后面加上 <code>opacity:0.7</code> 改为</p>
<figure class="highlight styl"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><span class="line">.layout_page</span><br><span class="line">  <span class="attribute">display</span>: flex</span><br><span class="line">  <span class="attribute">align-items</span>: flex-start</span><br><span class="line">  <span class="attribute">margin</span>: <span class="number">0</span> auto</span><br><span class="line">  <span class="attribute">padding</span>: <span class="number">2rem</span> <span class="number">15px</span></span><br><span class="line">  <span class="attribute">max-width</span>: <span class="number">1200px</span></span><br><span class="line">  <span class="attribute">opacity</span>:<span class="number">0.7</span></span><br></pre></td></tr></table></figure>

<p>这里的 0.7 是透明度, 取值 0~1 , 越大越不透明, 越小越透明, 可以自己取值.</p>
<h1 id="post-文章侧边栏去掉滚动条"><a href="#post-文章侧边栏去掉滚动条" class="headerlink" title="post 文章侧边栏去掉滚动条"></a>post 文章侧边栏去掉滚动条</h1><p>文章有标题时, 左边就会出现侧边栏, 而侧边栏的滚动条实在是不太美观, 于是隐藏掉.</p>
<p>进入 <code>layout/includes/sidebar.pug</code> 看到以下内容</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">if (page.encrypt &#x3D;&#x3D; true)</span><br><span class="line">  div.sidebar-toc__content.toc-div-class(style&#x3D;&quot;display:none&quot;)!&#x3D;toc(page.origin, &#123;list_number: tocNumber&#125;)</span><br><span class="line">else </span><br><span class="line">  div.sidebar-toc__content!&#x3D;toc(page.content, &#123;list_number: tocNumber&#125;)</span><br></pre></td></tr></table></figure>

<p>只要为侧边栏加一个 <code>style=&quot;overflow: hidden;&quot;</code> 就能隐藏滚动条, 因此改为</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">if (page.encrypt &#x3D;&#x3D; true)</span><br><span class="line">  div.sidebar-toc__content.toc-div-class(style&#x3D;&quot;display:none&quot;)!&#x3D;toc(page.origin, &#123;list_number: tocNumber&#125;)</span><br><span class="line">else </span><br><span class="line">  div.sidebar-toc__content(style&#x3D;&quot;overflow: hidden;&quot;)!&#x3D;toc(page.content, &#123;list_number: tocNumber&#125;)</span><br></pre></td></tr></table></figure>

<p>就好了.</p>
<h1 id="非-post-随机-banner-网页背景-页脚图片"><a href="#非-post-随机-banner-网页背景-页脚图片" class="headerlink" title="非 post 随机 banner , 网页背景, 页脚图片"></a>非 post 随机 banner , 网页背景, 页脚图片</h1><h2 id="页脚-banner-头图设置为透明"><a href="#页脚-banner-头图设置为透明" class="headerlink" title="页脚, banner 头图设置为透明"></a>页脚, banner 头图设置为透明</h2><h3 id="页脚"><a href="#页脚" class="headerlink" title="页脚"></a>页脚</h3><p>在 <code>butterfly/layout/includes/layout.pug</code> 下找到如下代码</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">- var footer_bg &#x3D; theme.footer_bg &#x3D;&#x3D; false ? &#39;&#39; : bg_img</span><br></pre></td></tr></table></figure>

<p>在其下面追加变成</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">- var footer_bg &#x3D; theme.footer_bg &#x3D;&#x3D; false ? &#39;&#39; : bg_img</span><br><span class="line">if !is_post()</span><br><span class="line">  - var footer_bg &#x3D; &#39;background-color: transparent;&#39;</span><br></pre></td></tr></table></figure>

<h3 id="banner-头图"><a href="#banner-头图" class="headerlink" title="banner 头图"></a>banner 头图</h3><p>在 <code>butterfly/layout/includes/header/index.pug</code> 下找到如下代码</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">#nav(class&#x3D;isHomeClass style&#x3D;bg_img)</span><br></pre></td></tr></table></figure>

<p>在其上追加变成</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">if !is_post()</span><br><span class="line">  - var bg_img &#x3D; &#39;background-color:transparent;&#39;</span><br><span class="line">#nav(class&#x3D;isHomeClass style&#x3D;bg_img)</span><br></pre></td></tr></table></figure>

<h2 id="随机背景设置"><a href="#随机背景设置" class="headerlink" title="随机背景设置"></a>随机背景设置</h2><p>在 <code>butterfly/layout/includes/layout.pug</code> 下找到如下代码</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">if theme.background</span><br><span class="line">  - var is_photo &#x3D; theme.background.substring(3,0) &#x3D;&#x3D;&#x3D; &#39;url&#39; ? &#39;photo&#39;:&#39;color&#39;</span><br></pre></td></tr></table></figure>

<p>改为</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">- var is_photo &#x3D; &#39;photo&#39;</span><br></pre></td></tr></table></figure>

<p>(对, 就是直接替换, 注意位置要一样, 当然你也可以把原来的代码注释掉)</p>
<p>然后在 <code>butterfly/layout/includes/layout.pug</code> 下找到如下代码</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">footer#footer(style&#x3D;footer_bg data-type&#x3D;is_bg)</span><br><span class="line">  !&#x3D;partial(&#39;includes&#x2F;footer&#39;, &#123;&#125;, &#123;cache:theme.fragment_cache&#125;)</span><br></pre></td></tr></table></figure>

<p>在其下追加变成</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">footer#footer(style&#x3D;footer_bg data-type&#x3D;is_bg)</span><br><span class="line">  !&#x3D;partial(&#39;includes&#x2F;footer&#39;, &#123;&#125;, &#123;cache:theme.fragment_cache&#125;)</span><br><span class="line">if !is_post()</span><br><span class="line">  script() var bg_index &#x3D; Math.floor(Math.random() * #&#123;theme.bg_num&#125;);var res &#x3D; &#39;background-image: url(&quot;https:&#x2F;&#x2F;cdn.jsdelivr.net&#x2F;gh&#x2F;cnyist&#x2F;banner&#x2F;&#39; + bg_index + &#39;-min.jpg&quot;); background-attachment: fixed;&#39;;document.getElementById(&#39;web_bg&#39;).style &#x3D; res</span><br></pre></td></tr></table></figure>

<p>同时在 <code>butterfly/_config.yml</code> 里添加以下内容</p>
<figure class="highlight yml"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment"># banner图数量</span></span><br><span class="line"><span class="attr">bg_num:</span> <span class="number">48</span></span><br></pre></td></tr></table></figure>

<p>当然这只是使用我的 banner 图片, 如果要用你自己的, 还需要相应的更改, 这需要图片的 url 符合一定的格式, 即</p>
<figure class="highlight markdown"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">前缀 + [从 0 开始递增序号] + 后缀</span><br></pre></td></tr></table></figure>

<p>然后将内容改成</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">footer#footer(style&#x3D;footer_bg data-type&#x3D;is_bg)</span><br><span class="line">  !&#x3D;partial(&#39;includes&#x2F;footer&#39;, &#123;&#125;, &#123;cache:theme.fragment_cache&#125;)</span><br><span class="line">if !is_post()</span><br><span class="line">  script() var bg_index &#x3D; Math.floor(Math.random() * #&#123;theme.bg_num&#125;);var res &#x3D; &#39;background-image: url(&quot;前缀&#39; + bg_index + &#39;后缀&quot;); background-attachment: fixed;&#39;;document.getElementById(&#39;web_bg&#39;).style &#x3D; res</span><br></pre></td></tr></table></figure>

<p>同时将 <code>_config.yml</code> 刚刚添加的配置设置为你的 banner 图数量.</p>
<p>举个例子, 我的 banner 图 url 就是</p>
<figure class="highlight markdown"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">前缀 + [从 0 开始递增序号] + -min.jpg</span><br></pre></td></tr></table></figure>

<p>其中某个 banner 图就是</p>
<p><a target="_blank" rel="noopener" href="https://cdn.jsdelivr.net/gh/cnyist/banner/3-min.jpg">https://cdn.jsdelivr.net/gh/cnyist/banner/3-min.jpg</a></p>
<p>其中 <code>https://cdn.jsdelivr.net/gh/cnyist/banner/</code> 就是我图片的 url 的前缀, <code>3</code> 即是 [从 0 开始递增序号] (也就是说还有 0, 1, 2…) , <code>-min.jpg</code> 是图片 url 的后缀.</p>
<p>只要你的图片的 url 由这三个部分组成, 那么就可以将前缀和后缀填入代码中, 这样就可以实现使用自己的 banner 了.</p>
<h1 id="footer-动态颜色"><a href="#footer-动态颜色" class="headerlink" title="footer 动态颜色"></a>footer 动态颜色</h1><p>这里只设置 post 文章中的 (避免与 page 的魔改冲突).</p>
<p>打开 <code>layout/includes/head.pug</code> , 添加以下内容</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">if is_post()</span><br><span class="line">  link(rel&#x3D;&#39;stylesheet&#39;, href&#x3D;&quot;footer.min.css&quot;)</span><br></pre></td></tr></table></figure>

<p>就好了.</p>
<h1 id="黑暗模式下-nav-处黑色浮块消除"><a href="#黑暗模式下-nav-处黑色浮块消除" class="headerlink" title="黑暗模式下 nav 处黑色浮块消除"></a>黑暗模式下 nav 处黑色浮块消除</h1><p>打开 <code>source/css/_mode/darkmode.styl</code> 找到如下字段</p>
<figure class="highlight styl"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br></pre></td><td class="code"><pre><span class="line">#nav</span><br><span class="line">  &amp;:before</span><br><span class="line">    <span class="attribute">position</span>: absolute</span><br><span class="line">    <span class="attribute">top</span>: <span class="number">0</span></span><br><span class="line">    <span class="attribute">right</span>: <span class="number">0</span></span><br><span class="line">    <span class="attribute">bottom</span>: <span class="number">0</span></span><br><span class="line">    <span class="attribute">left</span>: <span class="number">0</span></span><br><span class="line">    background-color: alpha($dark-black, .7)</span><br><span class="line">    <span class="attribute">content</span>: <span class="string">&#x27;&#x27;</span></span><br></pre></td></tr></table></figure>

<p>去掉 <code>background-color</code> 改为</p>
<figure class="highlight styl"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br></pre></td><td class="code"><pre><span class="line">#nav</span><br><span class="line">  &amp;:before</span><br><span class="line">    <span class="attribute">position</span>: absolute</span><br><span class="line">    <span class="attribute">top</span>: <span class="number">0</span></span><br><span class="line">    <span class="attribute">right</span>: <span class="number">0</span></span><br><span class="line">    <span class="attribute">bottom</span>: <span class="number">0</span></span><br><span class="line">    <span class="attribute">left</span>: <span class="number">0</span></span><br><span class="line">    <span class="attribute">content</span>: <span class="string">&#x27;&#x27;</span></span><br></pre></td></tr></table></figure>

<h2 id="随机-banner"><a href="#随机-banner" class="headerlink" title="随机 banner"></a>随机 banner</h2><p>Butterfly 主题的 banner 大图一个页面是只有一张的, 并且主题配置里也没有多张的设置, 因此如果你想要实现 banner 能够随机显示, 那么就需要魔改主题.</p>
<h2 id="2-1-0"><a href="#2-1-0" class="headerlink" title="2.1.0"></a>2.1.0</h2><p>在 <code>Butterfly/layout/includes/nav.pug</code> 文件中添加以下内容</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">script document.getElementById(&quot;nav&quot;).style &#x3D; &#39;background-image: url(&quot;&#39; + Math.floor(Math.random()*9) + &#39;.jpg&quot;); background-attachment: fixed;&#39;</span><br></pre></td></tr></table></figure>

<p>在以上的代码中需要将 <code>cnyist</code> 换成你自己的 github 用户名 (如果你是部署在 github 上的话). 其原理就是利用 js 生成 0-8 的随机数, 然后修改 banner 图.</p>
<p>当然仅仅加这段代码是没有用的, 还要在 <code>Butterfly/source/img/banner/</code> 下 (没有文件夹就自己创建) 放你自己想用的 banner 大图, 名字限定在 [0-8].jpg. 如果要增加 banner 图片的话名字就继续递增, 同时上面的代码中的 <code>9</code> 改成你的 banner 图数量. 当然如果数量不足 9 张, 那么同样也要改成你的 banner 图数量.</p>
<p>这段代码还会把文章的 banner 也变为随机 banner 而不是 cover, 于是如果想要文章的 banner 还是原来的图的话, 那就再加一个条件判断.</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">if !is_post()</span><br><span class="line">  script document.getElementById(&quot;nav&quot;).style &#x3D; &#39;background-image: url(&quot;&#39; + Math.floor(Math.random()*9) + &#39;.jpg&quot;); background-attachment: fixed;&#39;</span><br></pre></td></tr></table></figure>

<h2 id="2-2-5"><a href="#2-2-5" class="headerlink" title="2.2.5"></a>2.2.5</h2><p>升级到 2.2.5 版本后, 发现原来的随机 banner 效果居然失效了! 然后查看源码才发现 <code>nav.png</code> 这个文件似乎被作者抛弃了, 将 banner 图的功能放在了 <code>Butterfly/layout/includes/header/index.pug</code> 里. 因此只要把以上代码放进这个文件里就行了, 代码的说明和上面是一样的, 至于 <code>nav.pug</code> 里的内容改不改都一样的.</p>
</article><div class="post-copyright"><div class="post-copyright__author"><span class="post-copyright-meta">文章作者: </span><span class="post-copyright-info"><a href="mailto:undefined">云玩家</a></span></div><div class="post-copyright__type"><span class="post-copyright-meta">文章链接: </span><span class="post-copyright-info"><a href="http://yunist.cn/hexo/butterfly_modify/">http://yunist.cn/hexo/butterfly_modify/</a></span></div><div class="post-copyright__notice"><span class="post-copyright-meta">版权声明: </span><span class="post-copyright-info">本博客所有文章除特别声明外，均采用 <a href="https://creativecommons.org/licenses/by-nc-sa/4.0/" target="_blank">CC BY-NC-SA 4.0</a> 许可协议。转载请注明来自 <a href="http://yunist.cn" target="_blank">云玩家</a>！</span></div></div><div class="tag_share"><div class="post-meta__tag-list"><a class="post-meta__tags" href="/tags/Hexo/">Hexo</a><a class="post-meta__tags" href="/tags/%E6%90%AD%E5%BB%BA%E7%AB%99%E7%82%B9/">搭建站点</a></div><div class="post_share"><div class="social-share" data-image="/hexo/butterfly_modify/butterfly_modify.jpeg" data-sites="facebook,twitter,wechat,weibo,qq"></div><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/social-share.js/dist/css/share.min.css" media="print" onload="this.media='all'"><script src="https://cdn.jsdelivr.net/npm/social-share.js/dist/js/social-share.min.js" defer></script></div></div><nav class="pagination-post" id="pagination"><div class="prev-post pull-left"><!-- - var pagination_cover = prev.cover === false ? prev.randomcover : prev.cover--><a href="/hexo/local_search_speed_up/"><img class="prev-cover" src="https://cdn.jsdelivr.net/gh/cnyist/blog/hexo/local_search_speed_up/local_search_speed_up.jpg" onerror="onerror=null;src='/img/404.jpg'" alt="cover of previous post"><div class="pagination-info"><div class="label">上一篇</div><div class="prev_info">解决 Hexo 本地搜索 search.xml 文件加载过慢</div></div></a></div><!-- - var pagination_cover = next.cover == false ? next.randomcover : next.cover--><div class="next-post pull-right"><a href="/math/probability_theory/beta/"><img class="next-cover" src="https://cdn.jsdelivr.net/gh/cnyist/blog/math/probability_theory/beta/beta.png" onerror="onerror=null;src='/img/404.jpg'" alt="cover of next post"><div class="pagination-info"><div class="label">下一篇</div><div class="next_info">Beta 函数, Beta 分布详解</div></div></a></div></nav><div class="relatedPosts"><div class="headline"><i class="fas fa-thumbs-up fa-fw"></i><span> 相关推荐</span></div><div class="relatedPosts-list"><div><a href="/hexo/Valine_reply/" title="Valine 评论回复发送重置密码邮件"><img class="cover" src="https://cdn.jsdelivr.net/gh/cnyist/blog/hexo/Valine_reply/Valine_reply.jpg" alt="cover"><div class="content is-center"><div class="date"><i class="far fa-calendar-alt fa-fw"></i> 2020-04-09</div><div class="title">Valine 评论回复发送重置密码邮件</div></div></a></div><div><a href="/hexo/back_blog_up/" title="手把手教你将博客备份到 Github"><img class="cover" src="https://cdn.jsdelivr.net/gh/cnyist/blog/hexo/back_blog_up/back_blog_up.png" alt="cover"><div class="content is-center"><div class="date"><i class="far fa-calendar-alt fa-fw"></i> 2020-04-10</div><div class="title">手把手教你将博客备份到 Github</div></div></a></div><div><a href="/hexo/hexo_d_github_problem/" title="hexo d 命令后 github 无法更新问题"><img class="cover" src="https://cdn.jsdelivr.net/gh/cnyist/blog/hexo/hexo_d_github_problem/hexo_d_github_problem.jpg" alt="cover"><div class="content is-center"><div class="date"><i class="far fa-calendar-alt fa-fw"></i> 2020-04-04</div><div class="title">hexo d 命令后 github 无法更新问题</div></div></a></div><div><a href="/hexo/hexo_modify_theme_butterfly/" title="Hexo modify theme butterfly"><img class="cover" src="https://cdn.jsdelivr.net/gh/cnyist/blog/hexo/hexo_modify_theme_butterfly/hexo_modify_theme_butterfly.svg" alt="cover"><div class="content is-center"><div class="date"><i class="far fa-calendar-alt fa-fw"></i> 2020-05-05</div><div class="title">Hexo modify theme butterfly</div></div></a></div><div><a href="/hexo/jsdelivr_js/" title="仅引入 JS 实现博客 CDN 加速"><img class="cover" src="https://cdn.jsdelivr.net/gh/cnyist/blog/hexo/jsdelivr_js/jsdelivr_js.jpg" alt="cover"><div class="content is-center"><div class="date"><i class="far fa-calendar-alt fa-fw"></i> 2020-04-28</div><div class="title">仅引入 JS 实现博客 CDN 加速</div></div></a></div><div><a href="/hexo/local_search_speed_up/" title="解决 Hexo 本地搜索 search.xml 文件加载过慢"><img class="cover" src="https://cdn.jsdelivr.net/gh/cnyist/blog/hexo/local_search_speed_up/local_search_speed_up.jpg" alt="cover"><div class="content is-center"><div class="date"><i class="far fa-calendar-alt fa-fw"></i> 2020-04-17</div><div class="title">解决 Hexo 本地搜索 search.xml 文件加载过慢</div></div></a></div></div></div><hr/><div id="post-comment"><div class="comment-head"><div class="comment-headline"><i class="fas fa-comments fa-fw"></i><span> 评论</span></div></div><div class="comment-wrap"><div><div id="twikoo-wrap"></div></div></div></div></div><div class="aside-content" id="aside-content"><div class="card-widget card-info"><div class="card-info-avatar is-center"><img class="avatar-img" src="https://cdn.jsdelivr.net/gh/cnyist/blog/img/avatar.svg" onerror="this.onerror=null;this.src='/img/friend_404.gif'" alt="avatar"/><div class="author-info__name">云玩家</div><div class="author-info__description">云玩家's blog</div></div><div class="card-info-data"><div class="card-info-data-item is-center"><a href="/archives/"><div class="headline">文章</div><div class="length-num">97</div></a></div><div class="card-info-data-item is-center"><a href="/tags/"><div class="headline">标签</div><div class="length-num">40</div></a></div><div class="card-info-data-item is-center"><a href="/categories/"><div class="headline">分类</div><div class="length-num">27</div></a></div></div><a class="button--animated" id="card-info-btn" target="_blank" rel="noopener" href="https://github.com/xxxxxx"><i class="fab fa-github"></i><span>Follow Me</span></a><div class="card-info-social-icons is-center"><a class="social-icon" href="https://github.com/cnyist" target="_blank" title="Github"><i class="fab fa-github"></i></a><a class="social-icon" href="https://blog.csdn.net/chnyist" target="_blank" title="CSDN"><i class="fas iconfont icon-CN_csdnnet"></i></a><a class="social-icon" href="https://www.zhihu.com/people/cnyist" target="_blank" title="知乎"><i class="fas iconfont icon-zhihu"></i></a><a class="social-icon" href="mailto:yunist@qq.com" target="_blank" title="Email"><i class="fas fa-envelope"></i></a></div></div><div class="card-widget card-announcement"><div class="item-headline"><i class="fas fa-bullhorn card-announcement-animation"></i><span>公告</span></div><div class="announcement_content">This is my Blog</div></div><div class="sticky_layout"><div class="card-widget" id="card-toc"><div class="item-headline"><i class="fas fa-stream"></i><span>目录</span></div><div class="toc-content"><ol class="toc"><li class="toc-item toc-level-1"><a class="toc-link" href="#Mathjax-%E5%85%AC%E5%BC%8F%E6%B8%B2%E6%9F%93%E5%8E%BB%E9%99%A4%E6%BB%9A%E5%8A%A8%E6%9D%A1"><span class="toc-number">1.</span> <span class="toc-text">Mathjax 公式渲染去除滚动条</span></a></li><li class="toc-item toc-level-1"><a class="toc-link" href="#%E8%AE%BE%E7%BD%AE%E5%8D%8A%E9%80%8F%E6%98%8E"><span class="toc-number">2.</span> <span class="toc-text">设置半透明</span></a></li><li class="toc-item toc-level-1"><a class="toc-link" href="#post-%E6%96%87%E7%AB%A0%E4%BE%A7%E8%BE%B9%E6%A0%8F%E5%8E%BB%E6%8E%89%E6%BB%9A%E5%8A%A8%E6%9D%A1"><span class="toc-number">3.</span> <span class="toc-text">post 文章侧边栏去掉滚动条</span></a></li><li class="toc-item toc-level-1"><a class="toc-link" href="#%E9%9D%9E-post-%E9%9A%8F%E6%9C%BA-banner-%E7%BD%91%E9%A1%B5%E8%83%8C%E6%99%AF-%E9%A1%B5%E8%84%9A%E5%9B%BE%E7%89%87"><span class="toc-number">4.</span> <span class="toc-text">非 post 随机 banner , 网页背景, 页脚图片</span></a><ol class="toc-child"><li class="toc-item toc-level-2"><a class="toc-link" href="#%E9%A1%B5%E8%84%9A-banner-%E5%A4%B4%E5%9B%BE%E8%AE%BE%E7%BD%AE%E4%B8%BA%E9%80%8F%E6%98%8E"><span class="toc-number">4.1.</span> <span class="toc-text">页脚, banner 头图设置为透明</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#%E9%A1%B5%E8%84%9A"><span class="toc-number">4.1.1.</span> <span class="toc-text">页脚</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#banner-%E5%A4%B4%E5%9B%BE"><span class="toc-number">4.1.2.</span> <span class="toc-text">banner 头图</span></a></li></ol></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E9%9A%8F%E6%9C%BA%E8%83%8C%E6%99%AF%E8%AE%BE%E7%BD%AE"><span class="toc-number">4.2.</span> <span class="toc-text">随机背景设置</span></a></li></ol></li><li class="toc-item toc-level-1"><a class="toc-link" href="#footer-%E5%8A%A8%E6%80%81%E9%A2%9C%E8%89%B2"><span class="toc-number">5.</span> <span class="toc-text">footer 动态颜色</span></a></li><li class="toc-item toc-level-1"><a class="toc-link" href="#%E9%BB%91%E6%9A%97%E6%A8%A1%E5%BC%8F%E4%B8%8B-nav-%E5%A4%84%E9%BB%91%E8%89%B2%E6%B5%AE%E5%9D%97%E6%B6%88%E9%99%A4"><span class="toc-number">6.</span> <span class="toc-text">黑暗模式下 nav 处黑色浮块消除</span></a><ol class="toc-child"><li class="toc-item toc-level-2"><a class="toc-link" href="#%E9%9A%8F%E6%9C%BA-banner"><span class="toc-number">6.1.</span> <span class="toc-text">随机 banner</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#2-1-0"><span class="toc-number">6.2.</span> <span class="toc-text">2.1.0</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#2-2-5"><span class="toc-number">6.3.</span> <span class="toc-text">2.2.5</span></a></li></ol></li></ol></div></div><div class="card-widget card-recent-post"><div class="item-headline"><i class="fas fa-history"></i><span>最新文章</span></div><div class="aside-list"><!-- - let post_cover = article.cover--><div class="aside-list-item"><a class="thumbnail" href="/math/set_theory/unique_ordinal/" title="序数的唯一性"><img src="https://cdn.jsdelivr.net/gh/cnyist/blog/math/set_theory/unique_ordinal/unique_ordinal.png" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="序数的唯一性"/></a><div class="content"><a class="title" href="/math/set_theory/unique_ordinal/" title="序数的唯一性">序数的唯一性</a><time datetime="2022-01-12T08:26:12.000Z" title="发表于 2022-01-12 16:26:12">2022-01-12</time></div></div><!-- - let post_cover = article.cover--><div class="aside-list-item"><a class="thumbnail" href="/math/mathematical_analysis/mathematical_analysis_practice/3/3-1/" title="(史济怀) 数学分析教程上册第 3 版-练习题 3.1"><img src="https://cdn.jsdelivr.net/gh/cnyist/blog/math/mathematical_analysis/mathematical_analysis_practice/3/3-1/math.jpeg" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="(史济怀) 数学分析教程上册第 3 版-练习题 3.1"/></a><div class="content"><a class="title" href="/math/mathematical_analysis/mathematical_analysis_practice/3/3-1/" title="(史济怀) 数学分析教程上册第 3 版-练习题 3.1">(史济怀) 数学分析教程上册第 3 版-练习题 3.1</a><time datetime="2021-10-19T00:30:55.000Z" title="发表于 2021-10-19 08:30:55">2021-10-19</time></div></div><!-- - let post_cover = article.cover--><div class="aside-list-item"><a class="thumbnail" href="/math/mathematical_analysis/mathematical_analysis_practice/2/2-11/" title="(史济怀) 数学分析教程上册第 3 版-练习题 2.11"><img src="https://cdn.jsdelivr.net/gh/cnyist/blog/math/mathematical_analysis/mathematical_analysis_practice/2/2-11/2-11.jpeg" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="(史济怀) 数学分析教程上册第 3 版-练习题 2.11"/></a><div class="content"><a class="title" href="/math/mathematical_analysis/mathematical_analysis_practice/2/2-11/" title="(史济怀) 数学分析教程上册第 3 版-练习题 2.11">(史济怀) 数学分析教程上册第 3 版-练习题 2.11</a><time datetime="2021-09-25T03:37:28.000Z" title="发表于 2021-09-25 11:37:28">2021-09-25</time></div></div><!-- - let post_cover = article.cover--><div class="aside-list-item"><a class="thumbnail" href="/math/mathematical_analysis/mathematical_analysis_practice/2/2-10/" title="(史济怀) 数学分析教程上册第 3 版-练习题 2.10"><img src="https://cdn.jsdelivr.net/gh/cnyist/blog/math/mathematical_analysis/mathematical_analysis_practice/2/2-10/2-10.jpeg" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="(史济怀) 数学分析教程上册第 3 版-练习题 2.10"/></a><div class="content"><a class="title" href="/math/mathematical_analysis/mathematical_analysis_practice/2/2-10/" title="(史济怀) 数学分析教程上册第 3 版-练习题 2.10">(史济怀) 数学分析教程上册第 3 版-练习题 2.10</a><time datetime="2021-09-22T07:36:49.000Z" title="发表于 2021-09-22 15:36:49">2021-09-22</time></div></div><!-- - let post_cover = article.cover--><div class="aside-list-item"><a class="thumbnail" href="/math/mathematical_analysis/mathematical_analysis_practice/2/2-9/" title="(史济怀) 数学分析教程上册第 3 版-练习题 2.9"><img src="https://cdn.jsdelivr.net/gh/cnyist/blog/math/mathematical_analysis/mathematical_analysis_practice/2/2-9/2-9.jpeg" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="(史济怀) 数学分析教程上册第 3 版-练习题 2.9"/></a><div class="content"><a class="title" href="/math/mathematical_analysis/mathematical_analysis_practice/2/2-9/" title="(史济怀) 数学分析教程上册第 3 版-练习题 2.9">(史济怀) 数学分析教程上册第 3 版-练习题 2.9</a><time datetime="2021-09-20T08:19:06.000Z" title="发表于 2021-09-20 16:19:06">2021-09-20</time></div></div></div></div></div></div></main><footer id="footer"><div id="footer-wrap"><div class="copyright">&copy;2020 - 2022 By 云玩家</div><div class="framework-info"><span>框架 </span><a target="_blank" rel="noopener" href="https://hexo.io">Hexo</a><span class="footer-separator">|</span><span>主题 </span><a target="_blank" rel="noopener" href="https://github.com/jerryc127/hexo-theme-butterfly">Butterfly</a></div></div></footer><script>document.getElementById('web_bg').style = 'background-image: url("' + get_rand_jsd_pic('cnyist', 'banner@master', '/', 70, '-min.jpg') + '")'</script></div><div id="rightside"><div id="rightside-config-hide"><button id="readmode" type="button" title="阅读模式"><i class="fas fa-book-open"></i></button><button id="darkmode" type="button" title="浅色和深色模式转换"><i class="fas fa-adjust"></i></button><button id="hide-aside-btn" type="button" title="单栏和双栏切换"><i class="fas fa-arrows-alt-h"></i></button></div><div id="rightside-config-show"><button id="rightside_config" type="button" title="设置"><i class="fas fa-cog fa-spin"></i></button><button class="close" id="mobile-toc-button" type="button" title="目录"><i class="fas fa-list-ul"></i></button><a id="to_comment" href="#post-comment" title="直达评论"><i class="fas fa-comments"></i></a><button id="go-up" type="button" title="回到顶部"><i class="fas fa-arrow-up"></i></button></div></div><div id="local-search"><div class="search-dialog"><div class="search-dialog__title" id="local-search-title">本地搜索</div><div id="local-input-panel"><div id="local-search-input"><div class="local-search-box"><input class="local-search-box--input" placeholder="搜索文章" type="text"/></div></div></div><hr/><div id="local-search-results"></div><span class="search-close-button"><i class="fas fa-times"></i></span></div><div id="search-mask"></div></div><div><script src="/js/utils.js"></script><script src="/js/main.js"></script><script src="/js/search/local-search.js"></script><div class="js-pjax"><script>(()=>{
  const $countDom = document.getElementById('twikoo-count')
  const init = () => {
    let initData = {
      el: '#twikoo-wrap',
      envId: 'yunist-147dfe',
      region: ''
    }

    if (false) {
      const otherData = false
      initData = Object.assign(initData, otherData)
    }
    
    twikoo.init(initData)
  }

  const getCount = () => {
    twikoo.getCommentsCount({
      envId: 'yunist-147dfe',
      region: '',
      urls: [window.location.pathname],
      includeReply: false
    }).then(function (res) {
      $countDom.innerText = res[0].count
    }).catch(function (err) {
      console.error(err);
    });
  }

  const loadTwikoo = (bool = false) => {
    if (typeof twikoo === 'object') {
      init()
      bool && $countDom && setTimeout(getCount,0)
    } else {
      getScript('https://cdn.jsdelivr.net/npm/twikoo/dist/twikoo.all.min.js').then(()=> {
        init()
        bool && $countDom && setTimeout(getCount,0)
      })
    }
  }

  if ('Twikoo' === 'Twikoo' || !false) {
    if (false) btf.loadComment(document.getElementById('twikoo-wrap'), loadTwikoo)
    else loadTwikoo(true)
  } else {
    window.loadOtherComment = () => {
      loadTwikoo()
    }
  }
})()</script></div><script async data-pjax src="//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script></div></body></html>